<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../jstl/taglibs.jsp"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta name="keywords" content="OVVI OTA Manager">
<meta name="description" content="OVVI OTA Manager">
<title>产品管理</title>
<%@ include file="../jstl/common_static_resources.jsp"%>
<script type="text/javascript" src="/static/web/js/product/modify.js"></script>
</head>
<body>
	<div class="page-container page-container-add">
		<form class="form form-horizontal" id="form-product-add" action="/product/save" method="post">
			<input type="hidden" value="${product.id }" name="id" /> <input type="hidden" value="${product.registertime}" name="registertime" />
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>产品名称：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" maxlength="255" value="${product.name }" placeholder="产品名称" id="name" name="name">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>价格：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" maxlength="255" value="${product.price }" placeholder="价格" id="price" name="price">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>购买地址：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="text" class="input-text" maxlength="255" value="${product.linkurl }" placeholder="购买地址" id="linkurl" name="linkurl">
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>广告商：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<span class="select-box"> <select id="advertiser" name="parentid" class="select">
							<c:forEach items="${advertisers}" var="advertiser" varStatus="status">
								<option value="${advertiser.id}" <c:if test="${product.parentid eq advertiser.id }">selected</c:if>>${advertiser.name }</option>
							</c:forEach>
					</select>
					</span>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>优先级：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<span class="select-box"> <select name="priority" class="select">
							<option value="1" <c:if test="${product.priority eq 1 }">selected</c:if>>1</option>
							<option value="2" <c:if test="${product.priority eq 2 }">selected</c:if>>2</option>
							<option value="3" <c:if test="${product.priority eq 3 }">selected</c:if>>3</option>
							<option value="4" <c:if test="${product.priority eq 4 }">selected</c:if>>4</option>
							<option value="5" <c:if test="${product.priority eq 5 }">selected</c:if>>5</option>
							<option value="6" <c:if test="${product.priority eq 6 }">selected</c:if>>6</option>
							<option value="7" <c:if test="${product.priority eq 7 }">selected</c:if>>7</option>
							<option value="8" <c:if test="${product.priority eq 8 }">selected</c:if>>8</option>
							<option value="9" <c:if test="${product.priority eq 9 }">selected</c:if>>9</option>
							<option value="10" <c:if test="${product.priority eq 10 }">selected</c:if>>10</option>
							<option value="11" <c:if test="${product.priority eq 11 }">selected</c:if>>11</option>
							<option value="12" <c:if test="${product.priority eq 12 }">selected</c:if>>12</option>
					</select>
					</span>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>是否启用：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<span class="select-box"> <select name="enable" class="select">
							<option value="1" <c:if test="${product.enable eq true }">selected</c:if>>启用</option>
							<option value="0" <c:if test="${product.enable eq false }">selected</c:if>>禁用</option>
					</select>
					</span>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>图标上传：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="hidden" value="${product.icon}" name="icon">
					<iframe src="/product/page?page=img_upload&icon=${product.icon}" width="100%" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe>
				</div>
			</div>
			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>大图上传：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<input type="hidden" value="${product.bigimg }" name="bigimg">
					<iframe src="/product/page?page=img_upload&bigimg=${product.bigimg}" width="100%" frameborder="0" scrolling="no" marginwidth="0" marginheight="0"></iframe>
				</div>
			</div>
			<%-- <div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>图标上传：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<c:if test="${not empty product.icon }">
						<img src="${product.icon }" width="50" />
					</c:if>
					<div class="uploader-list-container">
						<input type="hidden" value="${product.icon}" id="icon" name="icon">
						<div class="queueList">
							<div id="dndArea" class="placeholder">
								<div id="filePicker-2"></div>
								<p>或将图片拖到这里</p>
							</div>
						</div>
						<div class="statusBar" style="display: none;">
							<div class="progress">
								<span class="text">0%</span> <span class="percentage"></span>
							</div>
							<div class="info"></div>
							<div class="btns">
								<div id="filePicker2"></div>
								<div class="uploadBtn">开始上传</div>
							</div>
						</div>
					</div>
				</div>
			</div> --%>
			<%-- 			<div class="row cl">
				<label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>大图上传：</label>
				<div class="formControls col-xs-8 col-sm-9">
					<div class="uploader-list-container">
						<input type="hidden" value="${product.bigimg}" id="bigimg" name="bigimgvalidate">
						<div class="queueList">
							<div id="dndArea-big" class="placeholder">
								<div id="filePicker-2-big"></div>
								<p>或将图片拖到这里</p>
							</div>
						</div>
						<div class="statusBar" style="display: none;">
							<div class="progress">
								<span class="text">0%</span> <span class="percentage"></span>
							</div>
							<div class="info"></div>
							<div class="btns">
								<div id="filePicker2-big"></div>
								<div class="uploadBtn">开始上传</div>
							</div>
						</div>
					</div>
				</div>
			</div> --%>
			<div class="row cl">
				<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
					<button class="btn btn-primary radius" type="submit">
						<i class="Hui-iconfont">&#xe632;</i> 保存并提交
					</button>
					<button onClick="layer_close();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
				</div>
			</div>
		</form>
	</div>
	<script type="text/javascript">
		function reinitIframe() {
			var iframes = $('iframe').get();
			for (var i = 0, j = iframes.length; i < j; i++) {
				try {
					var iframe = iframes[i];
					var bHeight = $('.page_container', iframe.contentWindow.document.body).outerHeight();
					iframe.height = bHeight + 20;
				} catch (ex) {
				}
			}
		}
	</script>
</body>
</html>